//
//
//
//  Created by panquanReabam.com on 15/9/23.
//  Copyright (c) 2015年 reabam.com. All rights reserved.
//
#import "NeedOrderDetailViewController.h"
#import "UIViewExt.h"
#import "HttpRequest.h"
#import "JSONKit.h"
#import "UIImageView+WebCache.h"
#import "RDVTabBarController.h"
#import "MJRefresh.h"
#import "GoodsView.h"
@interface NeedOrderDetailViewController ()<MBProgressHUDDelegate,UIGestureRecognizerDelegate,UINavigationControllerDelegate,UITextFieldDelegate,UITextViewDelegate,UISearchBarDelegate,UIScrollViewDelegate>
@property (strong, nonatomic) NSString*GuideCode;
@property (strong, nonatomic) NSString*whsInTypeCode;
@property (strong, nonatomic) NSString*whsId;
@property (strong, nonatomic) NSString*WhsInType;
@end

@implementation NeedOrderDetailViewController
{

    UIButton*daogouname;
    UIButton*leixingBtn;
    UIButton*leixingBtn1;
    UIView*view;
    UIView*view1;
    GoodsView*shangpingView;
    UIScrollView*mainScroll;
    UIScrollView*MYmainScroll;
    UILabel*huiyuanname;
    UIButton *tureBtn;
    UILabel*dingdanhao1;
    BOOL saveAccount;
    UIButton *xuanze;
    NSMutableArray* arrrss;
    UILabel* weightke;
    UIView*view2;
    UIView*view3;
    UIView*view4;
    UIView*view5;
    UIView*view6;
    UITextView* tv;
    UILabel * label;
    UIImageView*imagess;
    UIView* myToolBar;
    UIButton*hejiMoney;
    UIButton*i12;
    
}
@synthesize alt = alt;

-(void)BackAction:(UIButton *)sender{
    
    NSUserDefaults*pushJudge = [NSUserDefaults standardUserDefaults];
    if([[pushJudge objectForKey:@"push"]isEqualToString:@"push"]) {
        NSUserDefaults * pushJudge = [NSUserDefaults standardUserDefaults];
        [pushJudge setObject:@""forKey:@"push"];
        [pushJudge synchronize];//记得立即同步
        [self dismissViewControllerAnimated:YES completion:nil];
        
    }else{
        [self.navigationController popViewControllerAnimated:YES];
    }
    
    
}
- (void)viewDidDisappear:(BOOL)animated
{
    [super viewDidDisappear:animated];
    self.navigationController.delegate = nil;
    
}
-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    
    [[self rdv_tabBarController] setTabBarHidden:YES];
    self.navigationController.navigationBarHidden=NO;
        self.navigationController.navigationBar.barStyle = UIBaselineAdjustmentNone;
    UILabel *lineLabel=[[UILabel alloc] initWithFrame:CGRectMake(0, 43,ScreenWidth, 1)];
    [lineLabel setBackgroundColor:[UIColor colorWithRed:238.0/255.0 green:238.0/255.0 blue:238.0/255.0 alpha:1.0]];
    [self.navigationController.navigationBar addSubview:lineLabel];
    [self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];
    [[UINavigationBar appearance] setBarTintColor:Color];
    
    UIImage* backImage = [UIImage imageNamed:@"fanhui"];
    CGRect backframe = CGRectMake(0,0,30,30);
    UIButton* backButton= [[UIButton alloc] initWithFrame:backframe];
    [backButton setBackgroundImage:backImage forState:UIControlStateNormal];
    backButton.titleLabel.textAlignment=NSTextAlignmentLeft;
    [backButton addTarget:self action:@selector(BackAction:) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem* leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
    self.navigationItem.leftBarButtonItem = leftBarButtonItem;
    self.navigationController.delegate = self;
    
    self.navigationController.interactivePopGestureRecognizer.delegate = self;
    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@""] forBarMetrics:UIBarMetricsDefault];
    self.navigationController.navigationBar.shadowImage =[[UIImage alloc] init];
    
    
    self.title = @"要货详情";
    [self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                                                     backColor,
                                                                     UITextAttributeTextColor,
                                                                     [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1],
                                                                     UITextAttributeTextShadowColor,
                                                                     [NSValue valueWithUIOffset:UIOffsetMake(0, 0)],
                                                                     UITextAttributeTextShadowOffset,
                                                                     [UIFont fontWithName:@"Helvetica Neue" size:tetlefot],
                                                                     UITextAttributeFont,nil]];
    
}

- (void)viewDidLoad
{
    
    [super viewDidLoad];
    NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
    NSString* Token = [user objectForKey:@"tokenId"];
    NSMutableDictionary *param = [NSMutableDictionary new];
    [param setValue:Token forKey:@"tokenId"];
    [param setValue:self.orderId forKey:@"needId"];
    [Global showIndeterminateHudSub:@"加载中，请稍后。。。" delay:30 view:self.view];
    [HttpRequest requestData:@"Business/NeedOrder/Detail" params:param success:^(BOOL isSuccess, SeverData *severDataDict) {
        if (isSuccess) {
  NSLog(@"====%@",severDataDict.dataDict);
            if ([[severDataDict.dataDict objectForKey:@"ResultInt"] integerValue]==0) {
                [Global hideProgressHUDInternal:self.view];
                
                MYmainScroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0,64, ScreenWidth, ScreenHeight)];
                [MYmainScroll setBackgroundColor: zuiqianhuiColor];
                MYmainScroll.delegate = self;
                MYmainScroll.userInteractionEnabled = YES;
                MYmainScroll.scrollEnabled = YES;
                MYmainScroll.showsVerticalScrollIndicator = FALSE;
                MYmainScroll.showsHorizontalScrollIndicator = FALSE;
                [self.view addSubview:MYmainScroll];
                view1=[[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 70)];
                view1.backgroundColor=[UIColor whiteColor];
                [MYmainScroll addSubview:view1];
                
                NSString *s2 =[severDataDict.dataDict objectForKey:@"needNo"];
                UIFont *font2 = [UIFont systemFontOfSize:17];
                CGSize size2 = CGSizeMake(ScreenWidth-60, 2000);
                CGSize labelsize2 = [s2 sizeWithFont:font2 constrainedToSize:size2 lineBreakMode:NSLineBreakByCharWrapping];
                
                UILabel* shelfNo=[[UILabel alloc]initWithFrame:CGRectMake(15, 15, labelsize2.width+5, 17)];
                shelfNo.text=[severDataDict.dataDict objectForKey:@"needNo"];
                shelfNo.textColor=[UIColor blackColor];
                shelfNo.font=[UIFont systemFontOfSize:17];
                [view1 addSubview:shelfNo];
                
                
                
                UILabel*isActive=[[UILabel alloc]initWithFrame:CGRectMake(shelfNo.right+5, 15, 230, 17)];
                if ([[NSString stringWithFormat:@"%@",  [severDataDict.dataDict objectForKey:@"needStatus"]]isEqualToString:@"Y"]) {
                    [isActive setTextColor:luseColor];
                    isActive.text=[NSString stringWithFormat:@"%@",[severDataDict.dataDict objectForKey:@"needStatusName"]];
                    
                }else
                if ([[NSString stringWithFormat:@"%@",  [severDataDict.dataDict objectForKey:@"needStatus"]]isEqualToString:@"N"]) {
                    
                    [isActive setTextColor:shenhongseColor];
                    isActive.text=[NSString stringWithFormat:@"%@",[severDataDict.dataDict objectForKey:@"needStatusName"]];

                }else if ([[NSString stringWithFormat:@"%@",  [severDataDict.dataDict objectForKey:@"needStatus"]]isEqualToString:@"C"]){
                    [isActive setTextColor:shenhuiColor];
                    isActive.text=[NSString stringWithFormat:@"%@",[severDataDict.dataDict objectForKey:@"needStatusName"]];

                
                }
                
                isActive.font= [UIFont systemFontOfSize:contenfot];
                [view1 addSubview:isActive];
                
                UILabel *line1=[[UILabel alloc] initWithFrame:CGRectMake(0, 70, ScreenWidth, 0.40)];
                line1.backgroundColor=qianhuiColor;
                [view1 addSubview:line1];
                UILabel* duogou=[[UILabel alloc]initWithFrame:CGRectMake(15, 85/2, 33, contenfot)];
                duogou.text=[NSString stringWithFormat:@"员工"];
                duogou.textColor=zhonghuiColor;
                duogou.font=[UIFont systemFontOfSize:contenfot];
                [view1 addSubview:duogou];
                NSString *createName1 = [severDataDict.dataDict objectForKey:@"createName"];
                UIFont *createNamefont1 = [UIFont systemFontOfSize:contenfot];
                CGSize createNamesize1 = CGSizeMake(ScreenWidth-60, 2000);
                CGSize createNamelabelsize1 = [createName1 sizeWithFont:createNamefont1 constrainedToSize:createNamesize1 lineBreakMode:NSLineBreakByCharWrapping];
                
                daogouname=[[UIButton alloc]initWithFrame:CGRectMake(duogou.right, 85/2,createNamelabelsize1.width+15,contenfot)];
                [daogouname setTitle:createName1 forState:UIControlStateNormal];
                daogouname.titleLabel.font=[UIFont systemFontOfSize:contenfot];
                daogouname.contentHorizontalAlignment=UIControlContentHorizontalAlignmentLeft;
                //[daogouname addTarget:self action:@selector(xuanzhidaogou:) forControlEvents:UIControlEventTouchUpInside];
                [daogouname setTitleColor:shenhuiColor forState:UIControlStateNormal];
                [view1 addSubview:daogouname];

                UILabel* orderDate=[[UILabel alloc]initWithFrame:CGRectMake(daogouname.right, 85/2, 33, contenfot)];
                orderDate.text=@"日期";
                orderDate.textColor=zhonghuiColor;
                orderDate.font=[UIFont systemFontOfSize:contenfot];
                [view1 addSubview:orderDate];
//                NSRange range={0,10};
                NSString* string =[severDataDict.dataDict  objectForKey:@"createDate"] ;
                UILabel* orderDate1=[[UILabel alloc]initWithFrame:CGRectMake(orderDate.right, 85/2, 180, contenfot)];
                orderDate1.text=string;
                orderDate1.textColor=shenhuiColor;
                orderDate1.font=[UIFont systemFontOfSize:contenfot];
                [view1 addSubview:orderDate1];
                
                
                view2=[[UIView alloc]initWithFrame:CGRectMake(0, view1.bottom+10, ScreenWidth, 175/2/2)];
                view2.backgroundColor=[UIColor whiteColor];
                view2.layer.borderWidth = 0.40;
                view2.layer.borderColor = qianhuiColor.CGColor;
                [MYmainScroll addSubview:view2];
                
           
                UILabel*leixing=[[UILabel alloc]initWithFrame:CGRectMake(15,0, 200, 175/2/2)];
                leixing.text=@"类型";
                leixing.textColor=shenhuiColor;
                leixing.font=[UIFont systemFontOfSize:contenfot];
                [view2 addSubview:leixing];
                leixingBtn=[[UIButton alloc]initWithFrame:CGRectMake(30,  0, ScreenWidth-50,175/2/2)];
                leixingBtn.titleLabel.font=[UIFont systemFontOfSize:contenfot];
                [leixingBtn setTitle:[severDataDict.dataDict objectForKey:@"ntypeName"] forState:UIControlStateNormal];
                
                leixingBtn.contentHorizontalAlignment=UIControlContentHorizontalAlignmentRight;
                
                [leixingBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
                [view2 addSubview:leixingBtn];
                view3=[[UIView alloc]initWithFrame:CGRectMake(0, view2.bottom+10, ScreenWidth, 45)];
                view3.backgroundColor=[UIColor whiteColor];
                [MYmainScroll addSubview:view3];
                UILabel *lineL=[[UILabel alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 0.40)];
                lineL.backgroundColor=qianhuiColor;
                [view3 addSubview:lineL];
                
                UILabel*shangpingxinxi=[[UILabel alloc]initWithFrame:CGRectMake(15, 0, 80, 45)];
                shangpingxinxi.text=@"商品信息";
                shangpingxinxi.textColor=qianheiColor;
                shangpingxinxi.font=[UIFont systemFontOfSize:15];
                [view3 addSubview:shangpingxinxi];
                
                
                NSNumber*Total = [severDataDict.dataDict objectForKey:@"totalMoney"];
                NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
                [numberFormatter setPositiveFormat:@"###,##0.00;"];
                NSString *formattedNumberString = [numberFormatter stringFromNumber:[NSNumber numberWithDouble:Total.doubleValue]];
                weightke=[[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth-250, 0, 230, 45)];
                weightke.text=[NSString  stringWithFormat:@"共 %@ 件，  ￥%@",[severDataDict.dataDict objectForKey:@"totalQuantity"], formattedNumberString];
                weightke.textColor = [UIColor colorWithRed:5.00/255.0 green:18.0/255.0 blue:40.00/255.0 alpha:1];
                weightke.textAlignment = NSTextAlignmentRight;
                weightke.font = [UIFont systemFontOfSize:16];
                NSMutableAttributedString *AttributedStr2 = [[NSMutableAttributedString alloc]initWithString:[NSString  stringWithFormat:@"共 %@ 件，  ￥%@",[severDataDict.dataDict objectForKey:@"totalQuantity"], formattedNumberString]];
                [AttributedStr2 addAttribute:NSFontAttributeName
                 
                                       value:[UIFont systemFontOfSize:13.0]
                 
                                       range:NSMakeRange(0, 8)];
                
                [AttributedStr2 addAttribute:NSForegroundColorAttributeName
                 
                                       value:zhonghuiColor
                 
                                       range:NSMakeRange(0, 8)];
                
                
                weightke.attributedText = AttributedStr2;
                [view3 addSubview:weightke];
                
                
                
                UILabel *lineLabel1=[[UILabel alloc] initWithFrame:CGRectMake(10, 45-0.40, ScreenWidth-20, 0.40)];
                lineLabel1.backgroundColor=qianhuiColor;
                [view3 addSubview:lineLabel1];
                
                
                arrrss=[severDataDict.dataDict  objectForKey:@"itemList"];
                
                NSLog(@"%@",arrrss);
                if (arrrss.count>0) {
                    
                    for (int i = 0; i<arrrss.count; i++) {
                        
                        shangpingView = [[GoodsView alloc]initWithFrame:CGRectMake(0, view3.bottom+(120*i), ScreenWidth, 120)];
                        shangpingView.backgroundColor=[UIColor whiteColor];
                        [shangpingView.headImageFull setImageWithURL:[[arrrss objectAtIndex:i] objectForKey:@"imageUrlFull"] placeholderImage:[UIImage imageNamed:@"zhengfangxing"]];
                        [shangpingView.headImageFull.layer setCornerRadius:6.0];
                        [shangpingView.headImageFull.layer setBorderWidth:0.5];
                        [shangpingView.headImageFull.layer setMasksToBounds:YES];
                        CGColorSpaceRef colorSpace2 = CGColorSpaceCreateDeviceRGB();
                        CGColorRef colorref2 = CGColorCreate(colorSpace2,(CGFloat[]){ 0.93, 0.93, 0.93, 0.93 });
                        [shangpingView.headImageFull.layer setBorderColor:colorref2];//边框颜色
                        
                        shangpingView.itemName.text=[NSString stringWithFormat:@"%@ %@",[[arrrss objectAtIndex:i] objectForKey:@"itemCode"],[[arrrss objectAtIndex:i] objectForKey:@"itemName"]];
                        

                        
                        
                        shangpingView.quantity.text=[NSString stringWithFormat:@"数量 %@",[[arrrss objectAtIndex:i] objectForKey:@"quantity"]];
                        
                        NSMutableAttributedString *AttributedStr1 = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"数量 %@",[[arrrss objectAtIndex:i] objectForKey:@"quantity"]]];
                        
                        [AttributedStr1 addAttribute:NSFontAttributeName
                         
                                               value:[UIFont systemFontOfSize:contenfot]
                         
                                               range:NSMakeRange(0, 3)];
                        
                        [AttributedStr1 addAttribute:NSForegroundColorAttributeName
                         
                                               value:zhonghuiColor
                         
                                               range:NSMakeRange(0, 3)];
                        
                        
                        shangpingView.quantity.attributedText = AttributedStr1;
                        
                        
                        NSNumber*Total =[[arrrss objectAtIndex:i] objectForKey:@"dealPrice"];
                        
                        NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
                        [numberFormatter setPositiveFormat:@"###,##0.00;"];
                        NSString *formattedNumberString = [numberFormatter stringFromNumber:[NSNumber numberWithDouble:Total.doubleValue]];
                        shangpingView.dealPrice.text=[NSString stringWithFormat:@"¥ %@",formattedNumberString];
                        shangpingView.dealPrice.textColor=hongseColor;
                      
                        
                        NSMutableAttributedString *AttributedStr12 = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"¥ %@",formattedNumberString]];
                        
                        [AttributedStr12 addAttribute:NSFontAttributeName
                         
                                                value:[UIFont systemFontOfSize:contenfot]
                         
                                                range:NSMakeRange(0, 1)];
                        
                        [AttributedStr12 addAttribute:NSForegroundColorAttributeName
                         
                                                value:hongseColor
                         
                                                range:NSMakeRange(0, 1)];
                        
                        
                        shangpingView.dealPrice.attributedText = AttributedStr12;
                        
                        
                        shangpingView.itemType.text=[NSString stringWithFormat:@"%@",[[arrrss objectAtIndex:i] objectForKey:@"specName"]];
                        
                        
                        
                        
                        if (i==arrrss.count-1) {
                            UILabel *lineLabel1=[[UILabel alloc] initWithFrame:CGRectMake(0, 120-0.40, ScreenWidth, 0.40)];
                            lineLabel1.backgroundColor=qianhuiColor;
                            [shangpingView addSubview:lineLabel1];
                        }else{
                            UILabel *lineLabel1=[[UILabel alloc] initWithFrame:CGRectMake(10, 120-0.40, ScreenWidth-20, 0.40)];
                            lineLabel1.backgroundColor=qianhuiColor;
                            [shangpingView addSubview:lineLabel1];
                            
                            
                        }
                        
                        [MYmainScroll addSubview:shangpingView];
                        }
                
                }else{
                
                
                     shangpingView = [[GoodsView alloc]initWithFrame:CGRectMake(0, view3.bottom, ScreenWidth, 120)];
                     shangpingView.itemName.text=@"无商品信息";
                    [MYmainScroll addSubview:shangpingView];
                
                }
                
      

                view6=[[UIView alloc]initWithFrame:CGRectMake(0, shangpingView.bottom+10, ScreenWidth, 80)];
                view6.backgroundColor=[UIColor whiteColor];
                view6.layer.borderWidth = 0.5;
                view6.layer.borderColor = qianhuiColor.CGColor;
                [MYmainScroll addSubview:view6];
                
                UILabel*remarkLabel=[[UILabel alloc]initWithFrame:CGRectMake(15, 0, ScreenWidth*70/750, 40)];
                remarkLabel.text=@"备注";
                remarkLabel.font= [UIFont systemFontOfSize:contenfot];
                [remarkLabel setTextColor:qianheiColor];
                [view6 addSubview:remarkLabel];
                
                NSString *s1 = [severDataDict.dataDict objectForKey:@"remark"];
                if (s1.length>0) {
                    
                }else{
                    s1=@"无";
                    
                }
                UIFont *font1 = [UIFont systemFontOfSize:contenfot];
                CGSize size1 = CGSizeMake(ScreenWidth-60, 2000);
                CGSize labelsize1 = [s1 sizeWithFont:font1 constrainedToSize:size1 lineBreakMode:NSLineBreakByCharWrapping];
                
                UILabel*remarkLabel1=[[UILabel alloc]initWithFrame:CGRectMake(15, remarkLabel.bottom, ScreenWidth-40, labelsize1.height+10)];
                remarkLabel1.text=s1;
                remarkLabel1.numberOfLines=0;
                remarkLabel1.font= [UIFont systemFontOfSize:contenfot];
                [remarkLabel1 setTextColor:shenhuiColor];
                [view6 addSubview:remarkLabel1];
                view6.frame=CGRectMake(0,shangpingView.bottom+10, ScreenWidth, labelsize1.height+70);
                
                
                
            if ([[NSString stringWithFormat:@"%@",  [severDataDict.dataDict objectForKey:@"needStatus"]]isEqualToString:@"Y"]) {
                UIView*cancelRemarkView=[[UIView alloc]initWithFrame:CGRectMake(0, view6.bottom+10, ScreenWidth, 80)];
                cancelRemarkView.backgroundColor=[UIColor whiteColor];
                cancelRemarkView.layer.borderWidth = 0.45;
                cancelRemarkView.layer.borderColor = qianhuiColor.CGColor;
                [MYmainScroll addSubview:cancelRemarkView];
                
                UILabel*cancelRemark=[[UILabel alloc]initWithFrame:CGRectMake(15, 0, 120, 40)];
                
                cancelRemark.text=@"受理信息";
                cancelRemark.font= [UIFont systemFontOfSize:contenfot];
                [cancelRemark setTextColor:qianheiColor];
                [cancelRemarkView addSubview:cancelRemark];
                
                NSString *cancelRemarks = [severDataDict.dataDict objectForKey:@"acceptRemark"];
                if (cancelRemarks.length>0) {
                    
                }else{
                    cancelRemarks=@"无";
                    
                }
                
                CGSize cancelRemarksize = [cancelRemarks sizeWithFont:font1 constrainedToSize:size1 lineBreakMode:NSLineBreakByCharWrapping];
                UILabel*cancelRemarkLabel=[[UILabel alloc]initWithFrame:CGRectMake(15, remarkLabel.bottom, ScreenWidth-40, cancelRemarksize.height+10)];
                cancelRemarkLabel.text=cancelRemarks;
                cancelRemarkLabel.numberOfLines=0;
                cancelRemarkLabel.font= [UIFont systemFontOfSize:contenfot];
                [cancelRemarkLabel setTextColor:shenhuiColor];
                [cancelRemarkView addSubview:cancelRemarkLabel];
                
                cancelRemarkView.frame=CGRectMake(0, view6.bottom+10, ScreenWidth, cancelRemarksize.height+70);
                
                
                
                MYmainScroll.contentSize = CGSizeMake(ScreenWidth, cancelRemarkView.bottom+100);

                    
            }else  if ([[NSString stringWithFormat:@"%@",  [severDataDict.dataDict objectForKey:@"needStatus"]]isEqualToString:@"N"]) {
                        
                       MYmainScroll.contentSize = CGSizeMake(ScreenWidth, view6.bottom+100);
                
                    }else if ([[NSString stringWithFormat:@"%@",  [severDataDict.dataDict objectForKey:@"needStatus"]]isEqualToString:@"C"]){
                            
                        UIView*cancelRemarkView=[[UIView alloc]initWithFrame:CGRectMake(0, view6.bottom+10, ScreenWidth, 80)];
                        cancelRemarkView.backgroundColor=[UIColor whiteColor];
                        cancelRemarkView.layer.borderWidth = 0.45;
                        cancelRemarkView.layer.borderColor = qianhuiColor.CGColor;
                        [MYmainScroll addSubview:cancelRemarkView];
                        
                        UILabel*cancelRemark=[[UILabel alloc]initWithFrame:CGRectMake(15, 0, 120, 40)];
                        
                        cancelRemark.text=@"拒绝信息";
                        cancelRemark.font= [UIFont systemFontOfSize:contenfot];
                        [cancelRemark setTextColor:qianheiColor];
                        [cancelRemarkView addSubview:cancelRemark];
                        
                        NSString *cancelRemarks = [severDataDict.dataDict objectForKey:@"acceptRemark"];
                        if (cancelRemarks.length>0) {
                            
                        }else{
                            cancelRemarks=@"无";
                            
                        }
                        
                        CGSize cancelRemarksize = [cancelRemarks sizeWithFont:font1 constrainedToSize:size1 lineBreakMode:NSLineBreakByCharWrapping];
                        UILabel*cancelRemarkLabel=[[UILabel alloc]initWithFrame:CGRectMake(15, remarkLabel.bottom, ScreenWidth-40, cancelRemarksize.height+10)];
                        cancelRemarkLabel.text=cancelRemarks;
                        cancelRemarkLabel.numberOfLines=0;
                        cancelRemarkLabel.font= [UIFont systemFontOfSize:contenfot];
                        [cancelRemarkLabel setTextColor:shenhuiColor];
                        [cancelRemarkView addSubview:cancelRemarkLabel];
                        
                        cancelRemarkView.frame=CGRectMake(0, view6.bottom+10, ScreenWidth, cancelRemarksize.height+70);
                        
                        
                        
                        MYmainScroll.contentSize = CGSizeMake(ScreenWidth, cancelRemarkView.bottom+100);

                    }

                
                
            
            }else{
                [Global hideProgressHUDInternal:self.view];
                NSString *requestResultStr=[severDataDict.dataDict objectForKey:@"ResultString"];
                [Global showTextHudSub:requestResultStr view:self.view];
            }
            }
        else
        {
            [Global hideProgressHUDInternal:self.view];
            [Global showTextHudSub:severDataDict.resultStr view:self.view];
        }
        
    }];
}
- (void)showAlertWait
{
    alt = [[UIAlertView alloc] initWithTitle:@"网络不稳定 ！" message:@"请确认网络" delegate:self cancelButtonTitle:nil otherButtonTitles: nil];
    [alt show];
    
    [self performSelector:@selector(hideAlert) withObject:nil afterDelay:1.0f];
    
}

- (void)showAlertMessage:(NSString *)msg
{
    alt = [[UIAlertView alloc] initWithTitle:@"温馨提示" message:msg delegate:nil cancelButtonTitle:nil otherButtonTitles: nil];
    [alt show];
    
    [self performSelector:@selector(hideAlert) withObject:nil afterDelay:1.0f];
}
- (void)hideAlert
{
    if (alt != nil)
    {
        [alt dismissWithClickedButtonIndex:0 animated:YES];
        alt = nil;
    }
}
@end
